<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>投票结果</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="refresh" content="1200">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .item .name {
            position: absolute;
            left: 0;
            line-height: 18px;
            text-align: left;
            padding-left: 20px;
            text-align: left;
            width: 100px;
        }
        .item .maoHao{
            position: absolute;
            left: 58px;
            line-height: 18px;
        }
        .item .name:after { content: " "; display: inline-block; width: 80%;}

        .item .time {
            /* float: right; */
            display: inline-block;
            color: #aaa;
            position: absolute;
            width: 120px;
            right: 10px;
            line-height: 18px;
            text-align: right;
        }
        @font-face {font-family: "iconfont";
            src: url('//at.alicdn.com/t/font_855021_i2jfy4r0uq.eot?t=1538037545426'); /* IE9*/
            src: url('//at.alicdn.com/t/font_855021_i2jfy4r0uq.eot?t=1538037545426#iefix') format('embedded-opentype'), /* IE6-IE8 */
            url('data:application/x-font-woff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j9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxjYGKAAC4G7ICFkYmRmZGFkZWBzb0ov7RAl604I7+0MJO9KiMxLzsxk4EBAGluB+8AAA==') format('woff'),
            url('//at.alicdn.com/t/font_855021_i2jfy4r0uq.ttf?t=1538037545426') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
            url('//at.alicdn.com/t/font_855021_i2jfy4r0uq.svg?t=1538037545426#iconfont') format('svg'); /* iOS 4.1- */
        }

        .iconfont {
            font-family:"iconfont" !important;
            font-size:16px;
            font-style:normal;
            cursor: pointer;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            margin-top: 2px;
            float: right;
            margin-right: 5px;
        }

        .icon-Group-:before { content: "\e684"; }

        .icon-shouqi:before { content: "\e614"; }

        .icon-zhankai:before { content: "\e62a"; }
        .item .center span {
            vertical-align: middle;
            display: table-cell;
            float: none;
            max-height: 60px;
            line-height: 18px;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            visibility: inherit;
            margin-top: 2px;
           /* overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;*/
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="oaLoad">
        <div class="loadGif" id="areaProgress"></div>
    </div>
    <table class="table-detail" border=0 cellSpacing=0 cellPadding=0 style="width: 100%; table-layout:auto">
       <!-- <tr class="no-print">
            <td colspan="4" class=" no-print td-module " style=" background-color: yellow;">第{{number2big(item.rownum)}}名：{{item.name}}（{{item.num?item.num:'0'}}）</td>
        </tr>-->
        <tbody  v-for="(item,i) in list">
        <tr class="no-print">
            <td colspan="4" class=" no-print td-module " style=" background-color: yellow;">第{{number2big(item.rownum)}}名：{{item.name}}（{{item.num?item.num:'0'}}）
                <template v-if="item.list&&item.list.length>3">
                     <span class="iconfont icon-shouqi" v-if="item.more"
                           @click="item.more=false"></span>
                    <span class="iconfont icon-zhankai"  v-else
                          @click="item.more=true"></span>
                </template>
            </td>
        </tr>
        <tr rowspan="3" v-for="(item2,i2) in item.list" v-if="item.more?item.list.length:i2<3">
            <td colspan="4" class="item" style="border-bottom: none"><span>
                <div class="name">{{item2.createUserName}}</div>
                <div class="maoHao">：</div>
                <div style="margin-left: 70px" class="center">
                    <span style="display: inline-block;float: left;width: 410px;text-align: left">{{item2.reason}}</span>
                    <span style="float: left;margin-left: 20px">{{formatDate(item2.createTime)}}</span>
                </div>
                </span>
            </td>
        </tr>
        <tr rowspan="3" v-if="!item.list||item.list.length==0"><td style="color:#ddd;">无投票信息</td></tr>
        </tbody>
    </table>
    <table class="table-detail" border=0 cellSpacing=0 cellPadding=0 style="width: 100%; table-layout:auto">
        <thead>
        <tr class="no-print">
            <td colspan="4" class=" no-print td-module " style=" background-color: yellow;">未投票人员（{{resultInfo.result1.num?resultInfo.result1.num:'0'}}）</td>
        </tr>
        </thead>
        <tbody>
        <td v-if="!resultInfo.result1.list&f1==0" style="color: rgb(221, 221, 221);">
            正在加载...
        </td>
        <td v-else>
            <div class="name" style="line-height: 29px;text-align: center;color:red;float:left;" v-for="(item,i2) in resultInfo.result1.list"><span class="ldName">&nbsp;&nbsp;&nbsp;{{item.name}}</span></div>
        </td>
        </tbody>
    </table>
    <table class="table-detail" border=0 cellSpacing=0 cellPadding=0 style="width: 100%; table-layout:auto">
        <thead>
        <tr class="no-print">
            <td colspan="4" class=" no-print td-module " style=" background-color: yellow;">未填写不投票理由人员（{{resultInfo.result2.num2?resultInfo.result2.num2:0}}）</td>
        </tr>
        </thead>
        <tbody>
        <td v-if="!resultInfo.result1.list&f1==0" style="color: rgb(221, 221, 221);">
            正在加载...
        </td>
        <td v-else>
            <div class="name" style="line-height: 29px;text-align: center;color:red;float:left;" v-for="(item,i2) in resultInfo.result2.list2"><span class="ldName">&nbsp;&nbsp;&nbsp;{{item.name}}</span></div>
        </td>
        </tbody>
    </table>
    <table class="table-detail" border=0 cellSpacing=0 cellPadding=0 style="width: 100%; table-layout:auto" v-if="(mainInfo.audit&&mainInfo.audit.length>0)||mainInfo.auditInfo">
        <thead>
        <tr>
            <td colspan="4" class=" no-print td-module " style=" background-color: yellow;" >审批进度</td>
        </tr>
        </thead>
    </table>
    <table v-if="mainInfo.auditInfo"  class="table-detail" style="width: 100%;table-layout: fixed;">
        <tr>
            <td class="td-title" style="width: 18%">驳回原因</td>
            <td  style="padding-left: 10px !important;text-align: left;">{{mainInfo.auditInfo}}</td>
        </tr>
    </table>
    <table class="table-detail" style="width: 100%;table-layout: fixed;" v-if="mainInfo.audit&&mainInfo.audit.length>0">
        <tbody >
        <tr>
            <td class="td-title" style="width: 50px;text-align: center;">审核人</td><td class="td-title" style="width: 60px;text-align: center;">审核状态</td><td class="td-title" style="width: 110px;text-align: center;">审核时间</td><td class="td-title" style="text-align: left;"><span style="margin-left: 39.5%">审核意见</span></td>
        </tr>
        <tr v-for="(item,i) in mainInfo.audit">
            <td style="color: #2a8cec;">
                <span class="ldName oaColor" >{{item.auditorName}}</span>
            </td>
            <td style="color: #2a8cec;text-align: center;">
                <span v-if="item.auditFlag===0" style="color:red;">待审核</span>
                <span v-else-if="item.auditFlag===1" class="oaColor">已通过</span>
                <span v-else-if="item.auditFlag===2"  class="oaColor">已驳回</span>
                <span v-else-if="item.auditFlag===-1" class="oaColor">未提交</span>
            </td>
            <td style="color: #2a8cec;text-align: center;" class="oaColor">
                {{formatDate(item.auditTime)}}
            </td>
            <td style="text-align: left;">
                <span style="color: #2a8cec;padding-left: 10px;" class="moreSpan oaColor" >{{item.auditAdvise}}</span>
            </td>
        </tr>


        </tbody>
    </table>
    <!--<div  style="height:30px;line-height:30px;text-align: center;z-index:999;padding-top:5px;margin-bottom: 15px"  v-if="auditFlag=='0'" >
        <input type="button" value="通过" @click="audit('1')"
               class="btn oaBtn btn-sm"
               style="margin-top:5px;">
        <input type="button" value="驳回" @click="audit('2')"
               class="btn oaBtn btn-sm"
               style="margin-top:5px;">
    </div>-->
    <div  style="height:30px;line-height:30px;text-align: center;z-index:999;padding-top:5px;margin-bottom: 15px">
        <input type="button" value="返回" @click="returnDt()"
               class="btn oaBtn btn-sm"
               style="margin-top:5px;">
    </div>
</section>


<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>

<script src="https://cdn.bootcss.com/vue/2.5.1/vue.min.js"></script>

<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var query = null;
    var app = new Vue({
        el: '#app',
        data: {
            selectTree:0,
            auditFlag:$.wyui.page.urlParams.auditFlag,
            selectBox:{
                companyList:[],
                departList:[],
                roleList:[],
                selectCompany:[],
                companyNames: [],
                departNames: [],
                roleNames: [],
                companyIds: [],
                userIds:[]
            },
            userInfo:{},
            resultInfo:{"result1":{},"result2":{}},
            userId: $.wyui.page.urlParams.userId,
            mainId:$.wyui.page.urlParams.mainId,
            title:"",
            date: "",
            list: [],
            mainInfo:{},
            auditInfo:"",
            isGo:true,
            showModel:false,
            userModel:false,
            treeObj:{},
            f1:0
        },
        methods: {
            number2big: function (number) {
                switch (Number(number)) {
                    case 1:
                        return '一';
                        break;
                    case 2:
                        return '二';
                        break;
                    case 3:
                        return '三';
                        break;
                    case 4:
                        return '四';
                        break;
                    case 5:
                        return '五';
                        break;
                    case 6:
                        return '六';
                        break;
                    case 7:
                        return '七';
                        break;
                    case 8:
                        return '八';
                        break;
                    case 9:
                        return '九';
                        break;
                    case 10:
                        return '十';
                        break;
                    case 11:
                        return '十一';
                        break;
                    case 12:
                        return '十二';
                        break;
                    case 13:
                        return '十三';
                        break;
                    case 14:
                        return '十四';
                        break;
                    case 15:
                        return '十五';
                        break;
                    case 16:
                        return '十六';
                        break;
                    case 17:
                        return '十七';
                        break;
                    case 18:
                        return '十八';
                        break;
                    case 19:
                        return '十九';
                        break;
                    case 20:
                        return '二十';
                        break;
                }
            },
            formatDate: function (now) {
                if(now) {
                    return new Date(now).Format(TimeFormat.middle)
                }
            },
            returnDt:function(){
               /* var pageId = top.getActivePageId('xjtp');
                var $iframe = top.findIframeByName("投票管理");
                $iframe[0].contentWindow.app.getList();
                console.log($iframe[0].contentWindow)
                top.closeTabByPageId(pageId);*/
               api.close();
            },
            getMain:function () {
                var _this = this; //声明一个变量指向Vue实例this，保证作用域一致
                $.wyui.postMethod("/vote/getMainInfoById.json", {"mainId":_this.mainId}, function (res) {
                    _this.mainInfo=res;
                    _this.selectBox.companyIds=res.companyIds.split(',')
                    _this.selectBox.departNames=res.departNames.split(',')
                    _this.selectBox.roleNames=res.roleNames.split(',')
                    /*_this.getCompanyList();
                    _this.hideLoading()*/
                });
            },
            audit: function (type) {
                var that = this;
                if (type == '1') {
                    top.$.alert({
                        win: this,
                        height: 180,
                        width: 300,
                        icon: '3', //1成功 2失败 3提示 不穿代表无图标
                        title: '确定要通过吗？',

                        blankclose: true,//点击空白是否可关闭
                        ok: "通过",//是否显示确认按钮,
                        okCallback: function (em, opts) {
                            //确认按钮回调
                            em.remove()
                            opts.close && opts.close()
                            advise = '同意！';
                            $.wyui.postLoadMethod("/vote/applyCreateAudit.json",{
                                id: that.mainId,
                                auditFlag: 1,
                                advise: '同意!',
                                userId: that.userInfo.id,
                            }, function (r) {
                                console.log(r)
                                api.close();
                            }, false, false)
                        },
                        cancel: "取消",
                        cancelCallback: function (em, opts) {
                            em.remove()
                            opts.close && opts.close()
                        }
                    })
                } else {
                    that.copierReturn();
                    return;
                }
            }
        },
        mounted: function () {
            var _this = this; //声明一个变量指向Vue实例this，保证作用域一致
            var that=this;
            this.getMain();
            _this.date = new Date().Format("hh:mm"); //修改数据date
            this.timer = setInterval(function () {
                _this.date = new Date().Format("hh:mm"); //修改数据date
            }, 1000)

            if(_this.userId) {
               /* $.wyui.postMethod("/vote/getUserInfoByUserId.json", {id: _this.userId}, function (info) {
                    _this.userInfo = info.userInfo;
                });*/
                $.wyui.postMethod(urlConfig.system.user.getUserViewById,{id:that.userId}, function (info) {
                    that.userInfo=info;
                });
            }

            $.wyui.postMethod("/vote/getResultList.json", {"mainId":_this.mainId}, function (res) {
                _this.list=res.result;
                console.log(_this.list)
            });
            var newlist=[];
            $.wyui.postMethod("/vote/getResultTypeList.json", {"mainId":_this.mainId}, function (res) {
                _this.resultInfo=res;
                if(_this.resultInfo.result2.list2&&_this.resultInfo.result2.list2.length>0){
                    for(var i=0;i<_this.resultInfo.result2.list2.length;i++){
                        var data=_this.resultInfo.result2.list2[i];
                        var str=true;
                        for(var b=0;b<_this.resultInfo.result1.list.length;b++){
                            var data2=_this.resultInfo.result1.list[b];
                            if(data.name==data2.name){
                                str= false;
                            }
                        }
                        if(str){
                            newlist.push(data)
                        }
                    }
                    if(newlist&&newlist.length>0){
                        _this.resultInfo.result2.list2=newlist
                        _this.resultInfo.result2.num2=newlist.length;

                    }
                }
                console.log(res)
                _this.f1=1;
            });
            console.log(newlist)


        }
    });
</script>

</body>
</html>